-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full Sync :: limit to contributors and above #21648
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
Full Sync tests need overhaul:
|
@@ -1026,9 +1031,9 @@ function test_full_sync_can_sync_individual_comments() { | |||
} | |||
|
|||
function test_full_sync_can_sync_individual_users() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a test here to confirm that a less-than-contributor is not included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_full_sync_sends_all_users creates a subscriber and verifies via the count that it doesn't get included.
I'm of the opinion that new tests have diminishing returns due to Full Sync being replaced with checksums.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with the provided instructions and it worked as expected.
It's worth noting that user_level
is "semi" deprecated. Something that's (almost) not used in core anymore... but it's still there and kept up to date in the user meta table.
It's updated based on the higher level of the level_%d
capabilities ( where %d
goes from 0
to 10
). All core roles still declare these caps and I checked that Woocommerce also does.
Other custom roles might not do it and will therefore be kept out of sync.
Yes user_level is "semi" deprecated however it still provides the most reasonable level for this limitation. We can't use "edit_post" or other single capabilities as it doesn't align fully with customizations. A non 0 level still is best way to exclude subscribers and other custom roles that don't have an "edit" / contributor role. |
# By renovate[bot] (3) and others # Via GitHub * master: Update dependency preact to v10.5.15 (#21635) Search: Migrate helper classes to standalone package (#21552) Release script: fix small typo (#21675) Update babel monorepo (#21668) Lock file maintenance (#21664) E2E tests: clean unused dependencies (#21639) Create JS Config package (#21592) Use webpack config JS package in Jetpack (#21581) add test runner to dev dependencies (#21591) Pexels Integration: Make the initial image search for example query run only once (#21641) Boost: make progress bar corners round on small screens (#21626) Full Sync :: limit to contributors and above (#21648) Sync Checksums : limit users based on user_level (#21645) Storybook: add Jetpack Spinner (#21511) Contact Info and Map widget: widget deprecation (#21554) Use webpack config js package in everything except Jetpack (#21580) # Conflicts: # pnpm-lock.yaml # projects/plugins/boost/package.json
* master: (24 commits) Update dependency preact to v10.5.15 (#21635) Search: Migrate helper classes to standalone package (#21552) Release script: fix small typo (#21675) Update babel monorepo (#21668) Lock file maintenance (#21664) E2E tests: clean unused dependencies (#21639) Create JS Config package (#21592) Use webpack config JS package in Jetpack (#21581) add test runner to dev dependencies (#21591) Pexels Integration: Make the initial image search for example query run only once (#21641) Boost: make progress bar corners round on small screens (#21626) Full Sync :: limit to contributors and above (#21648) Sync Checksums : limit users based on user_level (#21645) Storybook: add Jetpack Spinner (#21511) Contact Info and Map widget: widget deprecation (#21554) Use webpack config js package in everything except Jetpack (#21580) Boost: Fix the official name to the JavaScript word reference (#21638) tools: Allow extra spaces in next-version tags (#21647) Publicize: always add an alt text to Open Graph Images (#21520) js-tools: Add missing eslint plugin dep (#21642) ...
Reduce included users in Full Syncs to contributor and above users. This is performed by an explicit check of the {$wpdb->prefix}user_level meta which correlates to a non 0 value.
Fixes https://wp.me/p9dueE-3JV
Changes proposed in this Pull Request:
Does this pull request change what data or activity we track or use?
NO
Testing instructions:
Create several users on your site, subscribers, contributors, admins, etc
Pre applying patch
Post applying patch